/**
 * 我的
 * @author Qasim <15750783791@163.com>
 * @version 2016/9/5
 */
var self = memberInfo = version = '';

document.addEventListener('plusready' , ready ,  false);

var self = '';

function ready(){
	
	self = plus.webview.currentWebview();
 	//提交反馈意见
	$('.feedback').on('tap' , function(){ 
		
		var content = $('.content').val();
		
		if(!content.trim()){
			
			toast('请输入内容');return;
			
		}
		plus.nativeUI.showWaiting('发布中...');  
		
		$.ajax({
			
			type:"post",
			
			url:apiRoot +'/Home/Message/addBusinessMsg/',
			
			data:{
				tid : (self.tid ? 34 : 24), 
				judge : self.tid,
				relevance : self.aid,
				uid: self.uid,
				user : self.nickname,
				title : self.nickname +'在' + new Date().toLocaleString() + '留言了 <<' + self.title+'>>',
				body : content
 			},
			success : function(data){
				
				plus.nativeUI.closeWaiting();
				
				if(data > 0){
					
					$('.content').val('');
					
					toast('发布成功');
					 
					self.close();
				}
			},
			error : function(e){
				
				console.log(JSON.stringify(e));
				
				plus.nativeUI.closeWaiting();
				
				toast('连接超时,请检查网络');
				
			}
		});
	})


}